<?php $this->load->view('common/head');?>
<?php echo admin_js_url('laydate');?>
<body class="no-skin">
<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">

                    </div>

                    <table class="table table-striped table-bordered">
                        <thead>
                        <tr>
                            <th class="center">ID</th>
                            <th class="center">项目名称</th>
                            <th class="center">参与人员</th>
                            <th class="center">分成数</th>
                            <th class="center">应结算</th>
                            <th class="center">未结算</th>
                            <th class="center">已结算</th>
                            <th class="center">备注</th>
                            <th class="center">进度</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(isset($intos)){?>
                            <?php foreach ($intos as $key => $val) { ?>
                                <tr>
                                    <td class="center"><?php echo $val['into_id']; ?></td>
                                    <td class="center"><?php echo $val['project_name']; ?></td>
                                    <td class="center"><?php echo $val['user_uname']; ?></td>
                                    <td class="center"><?php echo $val['into_num']; ?></td>
                                    <td class="center"><?php echo $val['into_num']*$val['project_money']; ?></td>
                                    <td class="center"><?php  echo $val['no_into_num']?></td>
                                    <td class="center"><?php  echo $val['settlement_monney']?></td>
                                    <td class="center"><?php echo $val['into_text']; ?></td>
                                    <td class="center">
                                        <span class="label label-sm"><?php if($val['into_status']==0){echo "未开始";} ?></span>
                                        <span class="label label-sm label-inverse"><?php if($val['into_status']==1){echo "制作中";} ?></span>
                                        <span class="label label-sm label-warning"><?php if($val['into_status']==2){echo "测试中";} ?></span>
                                        <span class="label label-sm label-success"><?php if($val['into_status']==3){echo "已完成";} ?></span>
                                    </td>
                                    <td class="center"><a class="green" href="<?php echo site_url(X_URL.'into/edit/'.$val['into_id']);?>" title="修改"><i class="ace-icon fa fa-pencil bigger-130"></i></a>&nbsp;
                                <?php if(isset($user) && $user['user_group']!=4){?>
                                        <a class="del red" href="javascript:;" val="<?php echo site_url(X_URL.'into/delete/'.$val['into_id']);?>" title="删除"><i class="ace-icon fa fa-trash bigger-130"></i></a>
                                    <?php if($val['into_status']==3 && $val['settlement_monney']<$val['into_num']*$val['project_money']){ ?>
                                        <a href="<?php echo site_url(X_URL.'settlement/add/'.$val['project_id'].'/'.$val['user_id']);?>" title="结算"><i class="ace-icon fa fa-plus-circle bigger-130"></i></a>&nbsp;
                                    <?php }?>
                                    <?php }?>
                                    </td>
                                </tr>
                            <?php } ?>
                        <?php } ?>
                        </tbody>
                    </table>
                    <?php if(isset($pagination)){?><ul class="pagination"><?php echo $pagination;?></ul><?php }?>

                    <!--                        {$page}-->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(".del").click(function () {
        var url = $(this).attr('val');
        bootbox.confirm({
            title: "系统提示",
            message: "确定要删除?",
            callback: function (result) {
                if (result) {
                    window.location.href = url;
                }
            },
            buttons: {
                "cancel": {"label": "取消"},
                "confirm": {
                    "label": "确定",
                    "className": "btn-danger"
                }
            }
        });
    });
</script>
</body>
</html>
